package cn.sangedon.review.analysis.controller;

import cn.sangedon.review.analysis.service.TodayStastaticsService;
import cn.sangedon.review.common.util.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 今日市场行情统计
 */
@RestController
@RequestMapping("today/stastics")
public class TodayStastaticsController {
    @Autowired
    private TodayStastaticsService todayStastaticsService;

    /**
     * 统计最近交易日上涨、下跌、平盘股票数量
     *
     * @return
     */
    @ApiOperation("统计最近交易日上涨、下跌、平盘股票数量")
    @GetMapping("market/status")
    public Result marketStatus() {
        return Result.okBuilder().data(todayStastaticsService.marketStatus()).build();
    }
}
